package com.cuixichang.minimalism.transfer.dto;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.util.Assert;
import com.cuixichang.minimalism.basal.core.BaseDTO;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
 * 角色信息管理表对象实体
 *
 * @author cuixichang
 * @date 2024-12-18
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class IRoleDTO extends BaseDTO{
   /**
    * 关联关系id
    */
    @JsonSerialize(using= ToStringSerializer.class)
    private Long parentId;
   /**
    * 角色名称
    */
    private String roleName;
   /**
    * 角色编码
    */
    private String roleCode;
   /**
    * 角色备注信息
    */
    private String roleRemark;
   /**
    * 是否是默认角色【0:否(默认);1:是】
    */
    private Boolean isDefault;
   /**
    * 系统编码
    */
    private String createSystemCode;

    @Override
    public void check() {
        Assert.hasText(roleName,"角色名称不能为空");
        Assert.hasText(roleCode,"角色编码不能为空");
        Assert.hasText(createSystemCode,"系统编码不能为空");
    }
}
